package com.app.jzgdirector.common.view;

import android.content.Context;
import android.view.View;

import com.app.jzgdirector.R;


/**
 * Created by zhangjianhui401 on 16/8/18.
 * （通用）Native界面统一加载框
 */
public class ProgressBarDialog extends BaseDialog {

    //private static final String TAG = "ProgressBarDialog";

    private ProgressBarLayout mProgressBarLayout;

    public ProgressBarDialog(Context context) {
        super(context, R.style.progress_dialog_style);
    }

    public ProgressBarDialog(Context context, int style) {
        super(context, style);
    }

    @Override
    public int getDialogLayout() {
        return -1;
    }

    @Override
    protected View getDialogView(Context context) {
        mProgressBarLayout = new ProgressBarLayout(context);
        return mProgressBarLayout;
    }

    public void init(Context context) {
        super.init(context);
        setCancelable(true);
        setCanceledOnTouchOutside(true);
    }

    /**
     * 显示对话框
     *
     * @param showWithBg 是否显示半透明黑色背景
     */
    public void show(boolean showWithBg) {
        mProgressBarLayout.show(showWithBg);
        show();
    }

    /**
     * 显示对话框
     *
     * @param showWithBg  是否显示半透明黑色背景
     * @param loadingHint 提示语
     */
    public void show(boolean showWithBg, String loadingHint) {
        mProgressBarLayout.show(showWithBg, loadingHint);
        show();
    }

    /**
     * 显示文本字体颜色
     *
     * @param color
     */
    public void setContentTextColor(int color) {
        mProgressBarLayout.setContentTextColor(color);
    }


}
